package com.me.waterphase.utils;

import java.util.ArrayList;
import java.util.Iterator;

import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;

public class DebugInfo {

	private SpriteBatch hud;
	private BitmapFont font;
	private ArrayList<String> infos;
	
	public DebugInfo()
	{
		
		infos = new ArrayList<String>();
		hud = new SpriteBatch();
		
		font = new BitmapFont();
		font.setColor(1.0f, 1.0f, 1.0f, 1.0f);
	}
	
	public void render()
	{
		hud.begin();
		
		int posY = 310;
		int posX = 10;
		
		for (Iterator<String> info = infos.iterator(); info.hasNext();) {
			String text = info.next();
			
			font.draw(hud, text, posX, posY);
			posY -= 15;
		}
		
		hud.end();
		
		infos.clear();
	}
	
	public void addLine(String title, String info)
	{
		infos.add(title + ": " + info);
	}
}
